package com.eqxiu.ieditor.commons.constants;

public enum HotWordCategoryEnum {
	IMAGE(1, "picture"), SAMPLE(2, "scene"), FONT(3, "font"), MUSIC(4, "song");
	private int code;
	private String view;

	private HotWordCategoryEnum(int code, String view) {
		this.code = code;
		this.view = view;
	}

	public int getCode() {
		return code;
	}

	public String getView() {
		return view;
	}

	public static String view(int code) {
		HotWordCategoryEnum[] cats = HotWordCategoryEnum.values();
		for (HotWordCategoryEnum categoryEnum : cats) {
			if (categoryEnum.getCode() == code) {
				return categoryEnum.getView();
			}
		}
		return null;
	}
}
